"use strict";

/**
 * @auther wtfssd
 * Created by wtfssd on 2017/11/3
 */
import * as React from 'react'

const {View, ScrollView, TouchableOpacity} = require('react-native');
const {connect} = require('react-redux');
import NavigationBar from 'react-native-navbar';
import {autoSize, commonProps, commonStyles} from "../../assets/styles/common";
import {Actions} from "react-native-router-flux";
import MyText from "../../component/MyText";
import NavBackButton from "../../component/BackButton";
import NavRightButton from "../../component/RightButton";
import Colors from "../../assets/styles/Colors";
import SearchBar from "../../component/SearchBar";
import Line from "../../component/Line";
import MyIcon from "../../component/icon";
import {buildingExtraInfo, buildingGuideMainInfo, supportList} from "../../assets/data";
import {SCREEN_HEIGHT, SCREEN_WIDTH} from "../../constant";

const {List, InputItem, DatePicker} = require('antd-mobile');

class PlaceExtraIntroducePage extends React.Component<any, any> {
    constructor(props: any, context: any) {
        super(props, context);
        this.state = {
            firstName: null,
            lastName: null,
            date: new Date()
        };
    }

    renderButton = () => {
        if (this.props.data.button) {
            return (
                <TouchableOpacity style={[commonStyles.centerVH, {backgroundColor: Colors.Active, padding: 15}]}
                                  onPress={() => {
                                      if (this.props.data.target) {
                                          Actions.push(this.props.data.target)
                                      }
                                  }}>
                    <MyText color={Colors.White}>{this.props.data.button}</MyText>
                </TouchableOpacity>
            )
        }
        return null;
    };

    render() {

        return (
            <View style={commonStyles.container}>
                <NavigationBar {...commonProps.navBar}
                               leftButton={<NavBackButton/>}
                               title={{title: this.props.title, tintColor: '#fff'}}
                />
                <View style={[commonStyles.flex1, {paddingTop:10}]}>
                    <ScrollView>
                        <View style={{padding: 10, display: 'flex', flex: 1}}>
                            <MyText fontSize={15} color={Colors.Brief} style={{lineHeight:18}}>{this.props.data.content}</MyText>
                        </View>

                    </ScrollView>
                    {this.renderButton()}
                </View>
            </View>
        );
    }
}


export default PlaceExtraIntroducePage;
